package com.lq.memo.controller;

import com.lq.email.entity.UserEmail;
import com.lq.memo.entity.MyResponse;
import com.lq.memo.service.UserEmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: memo
 * @description:
 * @author: LQ
 * @create: 2021-11-24 11:01
 */
@RequestMapping("/userEmail")
@RestController
public class UserEmailController {

    @Autowired
    UserEmailService userEmailService;

    @PostMapping("/addUserEmail")
    public MyResponse addUserEmail(UserEmail userEmail) {
        MyResponse myResponse = new MyResponse();
        userEmailService.addUserEmail(userEmail);
        return myResponse;
    }

    @PostMapping("/getUserEmail")
    public MyResponse getUserEmail(UserEmail userEmail) {
        UserEmail userEmailResult = userEmailService.getUserEmail(userEmail);
        return new MyResponse().success().data(userEmailResult);
    }
}
